<?php

namespace App\Models\User\Repositories\Interfaces;

use App\Models\User\WechatOfficialUser;

interface WechatOfficialUserRepositoryInterface
{
    public function addData(array $data): WechatOfficialUser;

    public function updateData(WechatOfficialUser $appUser, array $data): bool;

    public function findByOpenId(string $openid): ?WechatOfficialUser;

    /**
     * 可能一个user 对应多个app_id 此处兼容
     * @param string $user_id
     * @param string $appid
     * @return WechatOfficialUser|null
     */
    public function findByAppIdAndUserId(string $user_id, string $appid = ''): ?WechatOfficialUser;
}